package thuyan.dtvt.bkhn;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.ImageButton;

public class MainActivity extends Activity {

	//Khai bao cac button
	private ImageButton btplay;
	private ImageButton btscore;
	private ImageButton btintroduce;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		//Khoi tao va xu ly cac button
		btplay = (ImageButton) findViewById(R.id.play);
		// xu ly su kien an nut play
		btplay.setOnClickListener(new View.OnClickListener() {

			public void onClick(View arg0) {
				doOpenPlayActivity();
			}

		});
		btscore = (ImageButton) findViewById(R.id.score);
		btscore.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				doOpenScoreActivity();
			}
		});
		btintroduce = (ImageButton) findViewById(R.id.introduce);
		btintroduce.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				doOpenIntroduceActivity();
			}
		});

	}

	public void doOpenPlayActivity() {
		// TODO Auto-generated method stub
		Intent myintent = new Intent(MainActivity.this, Play.class);
		startActivity(myintent);
	}

	public void doOpenScoreActivity() {
		// TODO Auto-generated method stub
		Intent myintent1 = new Intent(MainActivity.this, Score.class);
		startActivity(myintent1);
	}

	public void doOpenIntroduceActivity() {
		// TODO Auto-generated method stub
		Intent myintent1 = new Intent(MainActivity.this, Introduce.class);
		startActivity(myintent1);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

}
